package com.work.api.main;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.work.dto.transport.TransportSearchDTO;
import com.work.service.main.ITShipForecastService;
import com.work.vo.main.TShipForecastVO;
import com.work.vo.transport.TShipForecastShipStatVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 理货船舶预报控制器
 *
 * @author ：dujianyu
 * @since ：Created in 2024/6/17 9:26
 */
@RestController
@AllArgsConstructor
@RequestMapping("tShipForecast")
@Api(value = "理货舱单交班记录控制器", tags = "理货舱单交班记录控制器")
public class TShipForecastController extends BladeController {

    private ITShipForecastService service;

    @GetMapping("/shipListForShipStatPage")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "货运船列表 给船统计用", notes = "传入dto")
    public R<IPage<TShipForecastShipStatVO>> transportShipListForShipStatPage(TransportSearchDTO dto, Query query) {
        IPage<TShipForecastShipStatVO> page = service.selectTransportShipListForShipStatPage(Condition.getPage(query), dto);
        return R.data(page);
    }

    @GetMapping("/detail")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "详情", notes = "传入transportShipId")
    public R<TShipForecastVO> detail(String transportShipId) {
        return R.data(service.selectDetail(transportShipId));
    }

}
